package dcutils.cards.mtg;

// Import JDK Classes
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

// Import DCUtils Classes
import dcutils.tuples.Pair;

/**
 * Represents a single planeswalker card in Magic the Gathering.<br/>
 * @author dca
 */
public class PlaneswalkerCard extends Card {
	private Integer loyalty;
	private List<Pair<Integer, String>> abilities = new LinkedList<>();

	public PlaneswalkerCard(
		String cardName,
		ManaCost manaCost,
		Rarity rarity,
		Expansion expansion,
		String planeswalkerName,
		Integer loyalty
	) {
		super(cardName, manaCost, rarity, expansion, String.format("Planeswalker - %s", planeswalkerName));
		setLoyalty(loyalty);
	} // END constructor

	public PlaneswalkerCard(
		String cardName,
		ManaCost manaCost,
		Rarity rarity,
		Expansion expansion,
		String planeswalkerName,
		Integer loyalty,
		Pair<Integer, String> ... abilities
	) {
		super(cardName, manaCost, rarity, expansion, String.format("Planeswalker - %s", planeswalkerName));
		setLoyalty(loyalty);
		setAbilities(Arrays.asList(abilities));
	} // END constructor

	public Integer getLoyalty() {
		return this.loyalty;
	} // END getLoyalty

	public void setLoyalty(Integer loyalty) {
		this.loyalty = loyalty;
	} // END setLoyalty

	public List<Pair<Integer, String>> getAbilities() {
		return this.abilities;
	} // END getAbilities

	public void setAbilities(List<Pair<Integer, String>> abilities) {
		this.abilities = abilities;
	} // END setAbilities

	public void addAbility(Pair<Integer, String> ability) {
		this.abilities.add(ability);
	} // END addAbility

	public void addAbility(Integer cost, String ability) {
		addAbility(new Pair<Integer, String>(cost, ability));
	} // END addAbility
} // END class PlaneswalkerCard
